import request from '@utils/request'

// 查询维修工信息
export function getMaintainerList (data) {
  return request({
    url: '/worker/getPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}


// 新增维修工信息
export function addMaintainer (data) {
  return request({
    url: '/worker/save',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改维修工信息
export function updateMaintainer (data) {
  return request({
    url: '/worker/update',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除维修工信息
export function deleteMaintainer (data) {
  return request({
    url: '/worker/delete',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导出维修工信息
export function exportMaintainer (data) {
  return request({
    url: '/worker/export',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}